package com.cxyd.common;

import com.cxyd.domain.MessageBody;

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

public class MessageQueue {
    private static final Queue<MessageBody> queue = new ConcurrentLinkedQueue<>();

    public static void addMsg(MessageBody msg) {
        queue.offer(msg);
    }

    public static MessageBody getMsg() {
        return queue.poll();
    }

    public static int getMsgCount() {
        return queue.size();
    }
}
